package Test;

import Index.*;
import gitobject.Blob;
import org.junit.Test;
import repository.Repository;

import java.io.*;

/**
 * @author shkstart
 * @create 2021-12-01 17:26
 */
public class IndexTest implements Serializable {
    @Test
    public void indexFile() throws Exception {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("D:\\hashcode\\.git\\index"));
        Blob obj = (Blob) ois.readObject();
        System.out.println(obj);
    }

    @Test
    public void indexTree() throws IOException {
        Repository repository = new Repository("D:\\hashcode");
        Index index = new Index();
        index = index.readObject();
        TreeNode tem = new TreeNode();
        TreeNode temp = index.getIndexTree();
        System.out.println(index.getBlobList());
        System.out.println(index);
        System.out.println(temp.getChildren());
//        for(TreeNode i : temp.getChildren()){
//            System.out.println(i);
//
//        }
    }


}
